import React, { useRef } from 'react'

function useFd() {
    const timer=useRef(null)
    function fd(cd){
        return (...arg)=>{
            clearTimeout(timer.current)
            timer.current=setTimeout(()=>{
                cd(...arg)
            },800)
        }
    }
  return fd
}

export default useFd
